﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="~/css/aui.css" />
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav aui-text-left header" id="header">
        <br />
        <h1> <a class="aui-btn aui-pull-right" tapmode="tapmode" onClick="openClub()"> <em class="aui-iconfont aui-icon-my"></em> </a> 排班更变申请 </h1>
    </header>

    <div class="aui-content aui-margin-b-15">
        <ul class="aui-list aui-form-list">
            <li class="aui-list-header">排班更变申请提交后会交由管理员处理，请耐心等待，排班以<a href="/doctor/myweek?id=@ViewData["id"]">我的排班</a>中数据为准</li>
            <li class="aui-list-item">
                <div class="aui-list-item-inner">
                    <div class="aui-list-item-label">
                        医生姓名
                    </div>
                    <div class="aui-list-item-label">
                        @ViewData["DocterName"]
                    </div>
                </div>
            </li>
        </ul>
    </div>
    @using (Html.BeginForm("WeekdboMessage", "doctor", FormMethod.Post))
    {
        <section class="aui-grid">
            <div class="aui-row">
                <div class="aui-col-xs-3">
                    <h3>
                        排班设置
                    </h3>
                </div>
                <input name="id" id="ID" type="hidden" value="@ViewData["id"]" />
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w1" id="w1">
                    <div class="aui-grid-label">周一</div>
                </div>
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w2" id="w2">
                    <div class="aui-grid-label">周二</div>
                </div>
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w3"  id="w3">
                    <div class="aui-grid-label">周三</div>
                </div>
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w4" id="w4">
                    <div class="aui-grid-label">周四</div>
                </div>
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w5" id="w5">
                    <div class="aui-grid-label">周五</div>
                </div>
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w6" id="w6">
                    <div class="aui-grid-label">周六</div>
                </div>
                <div class="aui-col-xs-3">
                    <input type="checkbox" class="aui-switch" name="w7" id="w7">
                    <div class="aui-grid-label">周日</div>
                </div>
            </div>
        </section>
        <div class="aui-list-item-inner">
            <p><button type="submit" class="aui-btn aui-btn-info aui-btn-block aui-btn-outlined"  id="sendBtn">提交</button></p>
        </div>
        <br/>
        <div class="aui-list-item-inner">
            <a href="/Doctor/Index"><p><div class="aui-btn aui-btn-info aui-btn-block aui-btn-outlined">返回主界面</div></p></a>
        </div>
    }



    <script src="~/lib/signalr/dist/browser/signalr.js"></script>
    <script type="text/javascript">
        const connection = new signalR.HubConnectionBuilder()
            .withUrl("/myChatHub")
            .configureLogging(signalR.LogLevel.Information)
            .build();
        connection.start().catch(err => console.error(err.toString()));

        document.getElementById("sendBtn").addEventListener("click", function () {
            var id = document.getElementById('ID').value;//从客户端中调用在此调用之前在自定义Hub定义的SendMessage方法         
            connection.invoke("SendMessage", id,2).catch(err => console.error(err.toString()));
        });
    apiready = function () {
    api.setStatusBarStyle({
    style: 'light'
    });
    api.parseTapmode();
    var header = $api.byId('header');
    var headerPos = $api.offset(header);
    var body_h = $api.offset($api.dom('body')).h;
    var header_h = $api.offset($api.byId('header')).h;
    api.openFrame({
    name: 'index_frm',
    url: '~/html/index_frm.html',
    bounces: true,
    rect: {
    x: 0,
    y: header_h,
    w: 'auto',
    h: 'auto'
    }
    })
    };
    function openClub() {
    var delay = 0;
    if (api.systemType != 'ios') {
    delay = 300;
    }
    api.openWin({
    name: 'club_win',
    url: '~/html/club_win.html',
    bounces: false,
    delay: delay,
    slidBackEnabled: true,
    vScrollBarEnabled: false,
    progress: {
    type: "page"
    }
    });
    }
    function closeWin() {
    api.closeWin({
    });
    }
    </script>


</body>
</html>

<script type="text/javascript" src="~/script/api.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.setStatusBarStyle({
            style: 'light'
        });
        api.parseTapmode();
        var header = $api.byId('header');
        var headerPos = $api.offset(header);
        var body_h = $api.offset($api.dom('body')).h;
        var header_h = $api.offset($api.byId('header')).h;
        api.openFrame({
            name: 'index_frm',
            url: '~/html/index_frm.html',
            bounces: true,
            rect: {
                x: 0,
                y: header_h,
                w: 'auto',
                h: 'auto'
            }
        })
    };
    function openClub() {
        var delay = 0;
        if (api.systemType != 'ios') {
            delay = 300;
        }
        api.openWin({
            name: 'club_win',
            url: '~/html/club_win.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    }
    function closeWin() {
        api.closeWin({
        });
    }
</script>
